package cj.primariaiquest.commons;

import org.springframework.beans.BeansException;
import org.springframework.beans.factory.config.BeanFactoryPostProcessor;
import org.springframework.beans.factory.config.ConfigurableListableBeanFactory;
import org.springframework.context.ApplicationContext;
import org.springframework.context.ApplicationContextAware;

public class ApplicationContextHolder implements ApplicationContextAware,
	BeanFactoryPostProcessor {

    private ApplicationContext context;
    private ConfigurableListableBeanFactory factory;

    public void setApplicationContext(ApplicationContext ctx)
	    throws BeansException {
	context = ctx;
    }

    public void postProcessBeanFactory(ConfigurableListableBeanFactory factory)
	    throws BeansException {
	this.factory = factory;
    }

    public ApplicationContext getContext() {
	return context;
    }

    public void setContext(ApplicationContext context) {
	this.context = context;
    }

    public ConfigurableListableBeanFactory getFactory() {
	return factory;
    }

    public void setFactory(ConfigurableListableBeanFactory factory) {
	this.factory = factory;
    }

}
